﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace EFCoreDemo
{
    [Table("Persons")]
    public class Person
    {
        public Person()
        {
        }
        public int Id { get; set; }
        [Column("Name"), Required, MaxLength(20)]
        public String Name { get; set; }
        public String Description { get; set; }

        [DefaultValue(10)]
        public int Age { get; set; }
        public DateTime Birthday { get; set; }

        [IgnoreDataMember]
        public String IgnoreStr { get; set; }

        //一个人可以有多本书 ,建议给一个初始化的List
        public List<Book> Books { get; set; } =new List<Book>();

    }
}

